import { IsString, IsObject, IsOptional, IsNumber, IsArray, IsBoolean } from 'class-validator';

export class InitializeFileSystemDto {
  @IsString()
  projectId: string;

  @IsObject()
  project: any;
}

export class WriteFileDto {
  @IsString()
  content: string;

  @IsOptional()
  @IsObject()
  options?: any;
}

export class DeleteFileDto {
  @IsNumber()
  userId: number;
}

export class ReadDirectoryDto {
  @IsOptional()
  @IsBoolean()
  recursive?: boolean;

  @IsOptional()
  @IsBoolean()
  includeTypeEntity?: boolean;
}

export interface FileSystemFile {
  name: string;
  path: string;
  type: 'file' | 'directory';
  content?: string;
  hash?: string;
  modifyTime?: number;
  entityType?: 'document' | 'type';
}

export interface InitializationResult {
  success: boolean;
  projectId: string;
  totalFiles: number;
  generatedFiles: number;
  updatedDocuments: number;
  updatedTypes: number;
  errors: string[];
  duration: number;
}

export interface ApiResponse<T = any> {
  success: boolean;
  message: string;
  data?: T;
  error?: string;
}